package com.ecnu.system.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class SearchConditionDto {
    @ApiModelProperty(value = "字段名，见/incubation/transfer/conditions")
    private String name;           // 字段名，如 "title", "author", "fullText"
    @ApiModelProperty(value = "输入值")
    private String value;           // 输入值

    @ApiModelProperty(value = "EXACT（精确）/ FUZZY（模糊）")
    private MatchType matchType;    // 精确 / 模糊
    @ApiModelProperty(value = "AND / OR")
    private LogicOperator logic;    // AND / OR
    @ApiModelProperty(value = "是否取反（NOT）")
    private boolean isNegated =false;      // 是否取反（NOT）
//    private List<SearchConditionDTO> subConditions; // 支持嵌套（如 (A AND B) OR C）

    // 枚举类型
    public enum MatchType { EXACT, FUZZY }
    public enum LogicOperator { AND, OR }
    public String getMatchTypeStr() {
        return matchType != null ? matchType.name() : null;
    }
}
